﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace VehicleManagement.Models
{
        // CREATE TABLE BreakRules
        //(
        //    BreakRulesID int PRIMARY KEY IDENTITY(1,1),
        //    CarID int REFERENCES CarInfo(CarID),
        //    DriverID int REFERENCES DriverInfo(DriverID),
        //    [Date] DateTime NOT NULL,
        //    Cost decimal(18, 2) DEFAULT 0,
        //    [Path] nvarchar(30),
        //    Location nvarchar(30),
        //    [Action] nvarchar(30),
        //    Unit nvarchar(30),
        //    Reason nvarchar(30),
        //    Blame nvarchar(30),
        //    Remark  nvarchar(100)
        //)

    public class BreakRules
    {
        public int BreakRulesID { get; set; }
        public int CarID { get; set; }
        public int DriverID { get; set; }

        [DisplayName("日期")]
        [Required(ErrorMessage = "日期不能为空")]
        public DateTime Date { get; set; }

        [DisplayName("违章罚款")]
        [Required(ErrorMessage = "罚款不能为空")]
        public decimal Cost { get; set; }

        [DisplayName("出车路线")]
        [StringLength(30, ErrorMessage = "路线不能超过30位")]
        public string Path { get; set; }

        [DisplayName("违章地点")]
        [StringLength(30, ErrorMessage = "地点不能超过30位")]
        public string Location { get; set; }

        [DisplayName("违章行为")]
        [StringLength(30, ErrorMessage = "行为不能超过30位")]
        public string Action { get; set; }

        [DisplayName("执行单位")]
        [StringLength(30, ErrorMessage = "单位不能超过30位")]
        public string Unit { get; set; }

        [DisplayName("出车事由")]
        [StringLength(30, ErrorMessage = "事由不能超过30位")]
        public string Reason { get; set; }

        [DisplayName("责任")]
        [StringLength(30, ErrorMessage = "责任不能超过30位")]
        public string Blame { get; set; }

        [DisplayName("备注")]
        [StringLength(30, ErrorMessage = "备注不能超过30位")]
        public string Remark { get; set; }

        [DisplayName("车牌号")]
        public virtual string CarNumber { get; set; }

        [DisplayName("司机姓名")]
        public virtual string DriverName { get; set; }

        public virtual string CompanyName { get; set; }
    }
}